package cn.cymym.dao;

import java.util.List;

import cn.cymym.domain.Arist;
import cn.cymym.utils.ComDao;

public class ArtistDaoImpl extends ComDao<Arist> implements ArtistDao{

	@Override
	public void addArtistInfo(Arist arist) {
		// TODO 艺术家入驻
		String sql = "UPDATE artist SET NAME =?,tellphone=?,email=?,artistCall=?,region=?,graduate=?,artworkType=?,note=? WHERE artistNumber=?";
		update(sql,arist.getName(),arist.getTellPhone(),arist.getEmail(),arist.getArtistCall(),arist.getRegion(),arist.getGraduate(),arist.getArtWorkType(),arist.getNote(),arist.getArtistNumber());
	}

	@Override
	public void addImg(String imgHeader, String imgPath, String ArtistNum) {
		// TODO 艺术家添加头像
		String sql = "INSERT INTO artist(artistNumber,imgHeader,imgPath) VALUES(?,?,?)";
		update(sql, ArtistNum,imgHeader,imgPath);
		
	}

	@Override
	public List<Arist> selectArtist() {
		// TODO 查询艺术家的姓名，头像，简介,艺术家编号
		String sql = "SELECT artistNumber,NAME,imgHeader,note FROM artist limit 4";
		return getList(sql);
	}

}
